namespace ext.direct
{
	using System;
	using System.Runtime.CompilerServices;
	using System.Html;
	using System.Collections;
	
	
	/// <summary>
	/// The {@link Ext.direct.RemotingProvider RemotingProvider} exposes access to
	/// server side methods on the client (a remote procedure call (RPC) type of
	/// connection where the client can initiate a procedure on the server).  This allows for code to be organized in a fashion that is maintainable,
	/// while providing a clear path between client and server, something that is
	/// not always apparent when using URLs.  To accomplish this the server-side needs to describe what classes and methods
	/// are available on the client-side. This configuration will typically be
	/// outputted by the server-side Ext.Direct stack when the API description is built.
	/// </summary>
	/// <htmlSummary>
	/// &lt;p&gt;The {@link Ext.direct.RemotingProvider RemotingProvider} exposes access to
	/// server side methods on the client (a remote procedure call (RPC) type of
	/// connection where the client can initiate a procedure on the server).&lt;/p&gt;
	///
	/// &lt;p&gt;This allows for code to be organized in a fashion that is maintainable,
	/// while providing a clear path between client and server, something that is
	/// not always apparent when using URLs.&lt;/p&gt;
	///
	/// &lt;p&gt;To accomplish this the server-side needs to describe what classes and methods
	/// are available on the client-side. This configuration will typically be
	/// outputted by the server-side Ext.Direct stack when the API description is built.&lt;/p&gt;
	/// </htmlSummary>
	/// <definedin>src\direct\RemotingProvider.js</definedin>
	[ScriptName("RemotingProvider")]
	[ScriptNamespace("Ext.direct")]
	[Imported()]
	public partial class RemotingProvider : ext.direct.JsonProvider
	{
		
		#region Constructors
		public RemotingProvider(ext.direct.RemotingProvider_Configuration config)
		{
		}
		
		/// <summary>Constructor</summary>
		public RemotingProvider()
		{
		}
		#endregion
		
		#region Fields
		/// <summary>
		/// Object literal defining the server side actions and methods. For example, if
		/// the Provider is configured with:
		/// 
		/// &quot;actions&quot;:{ // each property within the &apos;actions&apos; object represents a server side Class
		/// &quot;TestAction&quot;:[ // array of methods within each server side Class to be
		/// { // stubbed out on client
		/// &quot;name&quot;:&quot;doEcho&quot;,
		/// &quot;len&quot;:1
		/// },{
		/// &quot;name&quot;:&quot;multiply&quot;,// name of method
		/// &quot;len&quot;:2 // The number of parameters that will be used to create an
		/// // array of data to send to the server side function.
		/// // Ensure the server sends back a Number, not a String.
		/// },{
		/// &quot;name&quot;:&quot;doForm&quot;,
		/// &quot;formHandler&quot;:true, // direct the client to use specialized form handling method
		/// &quot;len&quot;:1
		/// }]
		/// }
		///  Note that a Store is not required, a server method can be called at any time.
		/// In the following example a client side handler is used to call the
		/// server side method &quot;multiply&quot; in the server-side &quot;TestAction&quot; Class:  
		/// TestAction.multiply(
		/// 2, 4, // pass two arguments to server, so specify len=2
		/// // callback function...
		/// </summary>
		/// <htmlSummary>
		/// Object literal defining the server side actions and methods. For example, if
		/// the Provider is configured with:
		/// &lt;pre&gt;&lt;code&gt;
		/// &quot;actions&quot;:{ // each property within the &apos;actions&apos; object represents a server side Class
		/// &quot;TestAction&quot;:[ // array of methods within each server side Class to be
		/// { // stubbed out on client
		/// &quot;name&quot;:&quot;doEcho&quot;,
		/// &quot;len&quot;:1
		/// },{
		/// &quot;name&quot;:&quot;multiply&quot;,// name of method
		/// &quot;len&quot;:2 // The number of parameters that will be used to create an
		/// // array of data to send to the server side function.
		/// // Ensure the server sends back a Number, not a String.
		/// },{
		/// &quot;name&quot;:&quot;doForm&quot;,
		/// &quot;formHandler&quot;:true, // direct the client to use specialized form handling method
		/// &quot;len&quot;:1
		/// }]
		/// }
		/// &lt;/code&gt;&lt;/pre&gt;
		/// &lt;p&gt;Note that a Store is not required, a server method can be called at any time.
		/// In the following example a &lt;b&gt;client side&lt;/b&gt; handler is used to call the
		/// server side method &quot;multiply&quot; in the server-side &quot;TestAction&quot; Class:&lt;/p&gt;
		/// &lt;pre&gt;&lt;code&gt;
		/// TestAction.multiply(
		/// 2, 4, // pass two arguments to server, so specify len=2
		/// // callback function after the server is called
		/// // result: the result returned by the server
		/// // e: Ext.Direct.RemotingEvent object
		/// function(result, e){
		/// var t = e.getTransaction();
		/// var action = t.action; // server side Class called
		/// var method = t.method; // server side method called
		/// if(e.status){
		/// var answer = Ext.encode(result); // 8
		///
		/// }else{
		/// var msg = e.message; // failure message
		/// }
		/// }
		/// );
		/// &lt;/code&gt;&lt;/pre&gt;
		/// In the example above, the server side &quot;multiply&quot; function will be passed two
		/// arguments (2 and 4). The &quot;multiply&quot; method should return the value 8 which will be
		/// available as the &lt;tt&gt;result&lt;/tt&gt; in the example above.
		/// </htmlSummary>
		/// <definedin>src\direct\RemotingProvider.js</definedin>
		[ScriptName("actions")]
		public object Actions;
		
		/// <summary>
		/// Namespace for the Remoting Provider (defaults to the browser global scope of window).
		/// Explicitly specify the namespace Object, or specify a String to have a
		/// {@link Ext#namespace namespace created} implicitly.
		/// </summary>
		/// <htmlSummary>
		/// Namespace for the Remoting Provider (defaults to the browser global scope of &lt;i&gt;window&lt;/i&gt;).
		/// Explicitly specify the namespace Object, or specify a String to have a
		/// {@link Ext#namespace namespace created} implicitly.
		/// </htmlSummary>
		/// <definedin>src\direct\RemotingProvider.js</definedin>
		[ScriptName("namespace")]
		public ext.auto.System_String_Or_System_Object Namespace;
		
		/// <summary>Required. The url to connect to the {@link Ext.Direct} server-side router.</summary>
		/// <htmlSummary>&lt;b&gt;Required&lt;b&gt;. The url to connect to the {@link Ext.Direct} server-side router.</htmlSummary>
		/// <definedin>src\direct\RemotingProvider.js</definedin>
		[ScriptName("url")]
		public string Url;
		
		/// <summary>
		/// Specify which param will hold the arguments for the method.
		/// Defaults to &apos;data&apos;.
		/// </summary>
		/// <htmlSummary>
		/// Specify which param will hold the arguments for the method.
		/// Defaults to &lt;tt&gt;&apos;data&apos;&lt;/tt&gt;.
		/// </htmlSummary>
		/// <definedin>src\direct\RemotingProvider.js</definedin>
		[ScriptName("enableUrlEncode")]
		public string EnableUrlEncode;
		
		/// <summary>
		/// true or false to enable or disable combining of method
		/// calls. If a number is specified this is the amount of time in milliseconds
		/// to wait before sending a batched request (defaults to 10).
		/// </summary>
		/// <htmlSummary>
		/// &lt;p&gt;&lt;tt&gt;true&lt;/tt&gt; or &lt;tt&gt;false&lt;/tt&gt; to enable or disable combining of method
		/// calls. If a number is specified this is the amount of time in milliseconds
		/// to wait before sending a batched request (defaults to &lt;tt&gt;10&lt;/tt&gt;).&lt;/p&gt;
		/// &lt;br&gt;&lt;p&gt;Calls which are received within the specified timeframe will be
		/// concatenated together and sent in a single request, optimizing the
		/// application by reducing the amount of round trips that have to be made
		/// to the server.&lt;/p&gt;
		/// </htmlSummary>
		/// <definedin>src\direct\RemotingProvider.js</definedin>
		[ScriptName("enableBuffer")]
		public ext.auto.System_Boolean_Or_System_Number EnableBuffer;
		
		/// <summary>Number of times to re-attempt delivery on failure of a call. Defaults to 1.</summary>
		/// <htmlSummary>Number of times to re-attempt delivery on failure of a call. Defaults to &lt;tt&gt;1&lt;/tt&gt;.</htmlSummary>
		/// <definedin>src\direct\RemotingProvider.js</definedin>
		[ScriptName("maxRetries")]
		public System.Number MaxRetries;
		
		/// <summary>The timeout to use for each request. Defaults to undefined.</summary>
		/// <htmlSummary>The timeout to use for each request. Defaults to &lt;tt&gt;undefined&lt;/tt&gt;.</htmlSummary>
		/// <definedin>src\direct\RemotingProvider.js</definedin>
		[ScriptName("timeout")]
		public System.Number Timeout;
		
		/// <summary>
		/// Fires immediately before the client-side sends off the RPC call.
		/// By returning false from an event handler you can prevent the call from
		/// executing.
		/// </summary>
		/// <definedin>src\direct\RemotingProvider.js</definedin>
		[ScriptName("beforecallEventName")]
		public const string BeforecallEventName = "beforecall";
		
		/// <summary>
		/// Fires immediately after the request to the server-side is sent. This does
		/// NOT fire after the response has come back from the call.
		/// </summary>
		/// <definedin>src\direct\RemotingProvider.js</definedin>
		[ScriptName("callEventName")]
		public const string CallEventName = "call";
		#endregion
		
		#region Events
		/// <summary>
		/// Fires immediately before the client-side sends off the RPC call.
		/// By returning false from an event handler you can prevent the call from
		/// executing.
		/// </summary>
		/// <definedin>src\direct\RemotingProvider.js</definedin>
		[ScriptName("beforecall")]
		public event ext.auto.Delegate_ext_direct_RemotingProvider_And_ext_Direct_Transaction_And_System_Object Beforecall;
		
		/// <summary>
		/// Fires immediately after the request to the server-side is sent. This does
		/// NOT fire after the response has come back from the call.
		/// </summary>
		/// <definedin>src\direct\RemotingProvider.js</definedin>
		[ScriptName("call")]
		public event ext.auto.Delegate_ext_direct_RemotingProvider_And_ext_Direct_Transaction_And_System_Object Call;
		#endregion
	}
}
